//
//  DFPageView.h
//  换换圈
//
//  Created by 艾柯斯 on 14-11-13.
//  Copyright (c) 2014年 艾柯斯. All rights reserved.
//

#import <UIKit/UIKit.h>


@class DFPageView;

@protocol DFPageViewDataSource <NSObject>

- (NSInteger)numberOfPageItemInPageView:(DFPageView*)pageView;

- (UIView*)pageView:(DFPageView*)pageView viewAtPageNumber:(NSInteger)pageNumber;
@end



@protocol DFPageViewDelegate <NSObject>

@optional
- (IBAction)pageView:(DFPageView*)pageView didPageNumberChangedFrom:(NSInteger)from to:(NSInteger)to;
- (IBAction)pageView:(DFPageView*)pageView didPageItemChangedFrom:(UIView*)from to:(UIView*)to;
@end


@interface DFPageView : UIView

@property (nonatomic,readonly) NSArray* pageItems;
@property (nonatomic) NSInteger currentPageNumber;
@property (nonatomic) UIView* currentPageItem;
@property (nonatomic) NSTimeInterval animationDuration;
@property (nonatomic,weak) IBOutlet id<DFPageViewDelegate> delegate;
@property (nonatomic,weak) IBOutlet id<DFPageViewDataSource> dataSource;


@property (nonatomic,readonly) BOOL carousel;

-(void)setCurrentPageNumber:(NSInteger)pageNumber animated:(BOOL)animated;

-(void)setCurrentPageItem:(UIView *)pageItem animated:(BOOL)animated;

-(void)setCarousel:(BOOL)carousel timeInterval:(NSTimeInterval)timeInterval;

-(NSUInteger)indexOfPageItem:(UIView*)pageItem;


-(void)reloadData;
@end
